<html>
<head><meta charset="utf-8"><title>missing diagnostics w/ nvim-lsp after bumping dependency · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/missing.20diagnostics.20w.2F.20nvim-lsp.20after.20bumping.20dependency.html">missing diagnostics w/ nvim-lsp after bumping dependency</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="235991958"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/missing%20diagnostics%20w/%20nvim-lsp%20after%20bumping%20dependency/near/235991958" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jimmy C <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/missing.20diagnostics.20w.2F.20nvim-lsp.20after.20bumping.20dependency.html#235991958">(Apr 24 2021 at 18:20)</a>:</h4>
<p>hey folks,</p>
<p>I've been using rust-analyzer w/ the nvim-lsp for a little while, and its been pretty great. However a few days ago I bumped up a dependency on one of the crates i've been building I noticed that all diagnostics were not being omitted, even with the most egregious of mistakes! On other projects on my machine, diagnostics seem to be working. some examples below:</p>
<p>working: <a href="https://asciinema.org/a/fAqy1FVh82MT5SUUjaLMiUwko">https://asciinema.org/a/fAqy1FVh82MT5SUUjaLMiUwko</a></p>
<p>broken, on my little toy: <a href="https://asciinema.org/a/hNJ4Phu6APZTBciFB8wp4yHXo">https://asciinema.org/a/hNJ4Phu6APZTBciFB8wp4yHXo</a></p>
<p>I'd like to dig down a little and figure this out. has anyone done debug work w/ neovim-lsp and rust-analyzer and would have some tips on where to start? </p>
<p>I poked around git issues, but there doesnt seem to be an exact match for this (maybe <a href="https://github.com/rust-analyzer/rust-analyzer/issues/8622">https://github.com/rust-analyzer/rust-analyzer/issues/8622</a>, but my project structure doesnt seem particularly exotic). If this behaviour is worth reporting as an issue on github I can be a little more precise with what i'm seeing there</p>
<p>fwiw, rust-analyzer version: rust-analyzer 2021-04-19-95-g07fb65abb</p>
<p>thanks, <br>
jimmy</p>



<a name="235992142"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/missing%20diagnostics%20w/%20nvim-lsp%20after%20bumping%20dependency/near/235992142" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lukas Wirth <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/missing.20diagnostics.20w.2F.20nvim-lsp.20after.20bumping.20dependency.html#235992142">(Apr 24 2021 at 18:22)</a>:</h4>
<p>Does everything else work fine, like completions and assists?</p>



<a name="235993236"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/missing%20diagnostics%20w/%20nvim-lsp%20after%20bumping%20dependency/near/235993236" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jimmy C <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/missing.20diagnostics.20w.2F.20nvim-lsp.20after.20bumping.20dependency.html#235993236">(Apr 24 2021 at 18:30)</a>:</h4>
<p>yeah everything else (completetion, assists, inlay type hints, etc) is working swimmingly.</p>
<p>The one thing I forgot to mention is that diagnostics for derive macros are present, but diagnostics for "normal" code are all missing</p>



<a name="237246091"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/missing%20diagnostics%20w/%20nvim-lsp%20after%20bumping%20dependency/near/237246091" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jimmy C <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/missing.20diagnostics.20w.2F.20nvim-lsp.20after.20bumping.20dependency.html#237246091">(May 03 2021 at 23:25)</a>:</h4>
<p>So I've been digging a bit, and I noticed that I am getting no AddDiagnostics messages being seen by main_loop.rs:handle (full enum variant is flycheck::Message::AddDiagnostic). I have a recent version of rust-analyzer built w/ debug signals, so I'm willing to step through this further.Has anyone seen this before or could anyone point me to the interface that generally emits diagnostics to be consumed by <code>handle_events</code>?</p>



<a name="237311736"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/missing%20diagnostics%20w/%20nvim-lsp%20after%20bumping%20dependency/near/237311736" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/missing.20diagnostics.20w.2F.20nvim-lsp.20after.20bumping.20dependency.html#237311736">(May 04 2021 at 12:08)</a>:</h4>
<p><span class="user-mention" data-user-id="407830">@Jimmy C</span> see the <code>flycheck</code> module, it emits <code>cargo check</code> diagnosticsz</p>



<a name="237419966"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/missing%20diagnostics%20w/%20nvim-lsp%20after%20bumping%20dependency/near/237419966" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jimmy C <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/missing.20diagnostics.20w.2F.20nvim-lsp.20after.20bumping.20dependency.html#237419966">(May 05 2021 at 00:04)</a>:</h4>
<p>thanks a ton! turns out after finnicking a little bit with log messages, I got flycheck to spit out an error saying that <code>cargo check --workspace --message-format=json --manifest-path /path/to/my/project --all-targets --all-features</code> was failing. When I reran this command locally, I saw it was failing with with "error: multiple packages link to native library <code>fontconfig</code>, but a native library can be linked only once" .</p>
<p>Lo and behold, there was a neglected member of this project's workspace that was causing this command to fail. once I fixed that, I had "normal" diagnostics back up across my project :) thanks for the tips. </p>
<p>TL;DR: if you lose diagnostics suddenly, but the rest of rust-analyzer works, try running <code>cargo check --workspace --message-format=json --manifest-path /path/to/Cargo.toml --all-targets --all-features</code> to see if anything fails. thanks for the tip <span class="user-mention" data-user-id="133169">@matklad</span></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>